import { defineStore } from "pinia"
import { ref } from 'vue'

export const useUserInfoStore = defineStore('userinfo', () => {
    //1.定义用户信息
    const userinfo = ref({})
    const updatepass = ref(false)
    //2.定义修改用户信息的方法
    const setInfo = (newInfo) => {
        userinfo.value = newInfo
    }
    //3.定义清空用户信息的方法
    const removeInfo = () => {
        userinfo.value = {}
    }
    const setupdatepass = (data) => {
        updatepass.value = data
    }
    return { userinfo, setInfo, removeInfo, updatepass, setupdatepass }
},
    {
        persist: true
    }
);

